﻿using System;
using System.Collections.Generic;
using System.Text;
using SharpHomeEngine;

namespace DeviceInterfaceTest
{
    
    public class TestDimmerSwitch : TestDevice
    {
        internal TagInt32 Dimmer;
        internal TagDigital Switch;

        public TestDimmerSwitch(TestDeviceInterface DeviceInterface, string Name)
            : base(DeviceInterface, Name)
        {
            Dimmer = new TagInt32(DeviceInterface, this, "Dimmer");
            Switch = new TagDigital(DeviceInterface, this, "Switch");
        }

        public bool ChangeState(Tag Tag, object Value)
        {
            if (Dimmer == Tag)
            {
                if (Dimmer.IsSameValueType(Value))
                {
                    System.Threading.Thread.Sleep(300);
                    return true;
                }
            }
            else if (Switch == Tag)
            {
                if (Switch.IsSameValueType(Value))
                {
                    System.Threading.Thread.Sleep(300);
                    return true;
                }
            }
            return false;
        }
    }
}
